home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
prntutil
/
printspc
/
printspc.doc
< prev
next >
Wrap
Text File
|
1995-04-25
|
7KB
|
152 lines
PrintSpec
Freeware Spectrum Picture Printer
for the Okimate 20 Printer
By Greg Wageman
The Spectrum picture format opened up new possibilities for the Atari ST
computer. By freeing us from the limitation of only 16 colors, Spectrum
made images on the ST look like they had never looked before. Unfortunately,
we can't take our computers and color monitors everywhere we go. If
you're like me, you'd been looking for a way to capture all those
colors on hardcopy.
Being a programmer, and impatient, I took matters into my own hands and
wrote PrintSpec.
PrintSpec uses the same halftoning techniques used by magazines and
newspapers to print black-and-white and full-color pictures on your
Okimate 20 printer. Spectrum pictures may be rendered in full color using
a color ribbon, or in greyscale using a black ribbon. Pictures may be
printed in two different sizes: 4 by 6 inches, which can be printed
two-to-a-page, and 7 by 9 inches, which fills nearly an entire 8.5 by 11
inch sheet.
HOW TO USE PRINTSPEC
Double-click on printspc.prg to start the program. When PrintSpec has
finished loading, you will be presented with a title box. Press return
or click on the button to continue. The title box is only shown once, no
matter how many pictures you print. After dismissing the title box, you
will be shown the main dialog box. The dialog allows you to set the
ribbon color, the picture size and the printer port from within PrintSpec.
PrintSpec reads your system's printer configuration to determine if you
have a color or black ribbon loaded, and which port the printer is
connected to. It uses this information to determine the defaults. If
you change the ribbon color or printer port within PrintSpec, however,
the system configuration is NOT updated.
When you have configured PrintSpec for the type of picture you wish to
print, click on "Continue" to exit the dialog. You will then be presented
with a file selector box. Select the Spectrum picture you wish to print,
either compressed or uncompressed. There will be a pause while PrintSpec
reads the picture from the disk (and uncompresses it, if necessary).
Now that the picture has been loaded into memory, PrintSpec displays a
bar graph that indicates the relative portions of printed and unprinted
picture. The bar is updated after PrintSpec has sent the data for each
complete print line.
PrintSpec translates the Spectrum picture into matrices of dots, then
into characters, and then sends the appropriate codes to the printer.
PrintSpec drives the Okimate in its 24-pin mode, so it takes a considerable
number of bytes to generate one pass of the printhead. Even so, PrintSpec
drives your printer faster than the printer will accept data (but only
slightly faster).
You may abort a printout once it's begun by pressing the "Undo" key. If
you are printing in color, printing will stop after the current line has
printed in all three colors. Buffering in the printer may cause it to
print more than one line after you press "Undo", however, particularly
when printing in black-and-white.
When printing completes, and after an abort, the configuration dialogue box
reappears. Clicking on "Quit" will terminate the program and return you to
the desktop.
CONSERVATION OF RIBBON
The Okimate 20's firmware causes the printhead to make a full pass across
the page when printing in color, even if the image does not take up the
entire page width. The printhead must do this in order to advance the ribbon
to the next color. Consequently, there is no way to reduce ribbon consumption
during color printing. During black-and-white printing, however, the
printhead only loads and advances the ribbon when actually printing, and
prints only to the rightmost edge of the image. A 4-by-6 black and white
picture will therefore use the least amount of ribbon.
OF RESOLUTIONS AND PIXELS
The Atari ST displays 320 pixels horizontally in an eight-inch area of the
SC1224 monitor. This is a horizontal resolution of 40 pixels per inch. In
the vertical direction, the ST displays 200 pixels in a six-inch area. This
is a vertical resolution of 33.33 pixels per inch. The ratio of horizontal
resolution to vertical is therefore 40/33.33, or about 1.2 to 1.
The Okimate 20 has a maximum resolution of 160 dots per inch horizontally,
and 144 dots per inch vertically. This is a ratio of 1.11 to 1, which doesn't
quite match the Atari screen's. However, the amount of distortion introduced
is not objectionable, so this high-resolution mode is exploited in the 4-by-6
inch mode of PrintSpec. A 3-by-3 halftoning matrix is used to render each
pixel of the image, resulting in 960 dots horizontally (not including the
left margin) and 600 dots vertically.
A 3-by-3 halftoning matrix provides 10 intensities. All ten are not needed
in color (since a Spectrum image only provides 8 intensities each for Red, Green
and Blue), so only eight are used per color, to reproduce the entire Spectrum
palette. The RGB values of the image are converted to the Cyan, Magenta and
Yellow values of the Okimate for color printing. When printing in black, the
RGB values of the Atari are converted to a luminance (brightness) value, and
all 10 possible intensity values are used to approximate the color image.
The Okimate 20 can also display 120 dots per inch horizontally at 144 dots
per inch vertically. This results in an exact 1.2 to 1 ratio when the
picture is rotated 90 degrees. This mode is used to print the 7-by-9 inch
pictures. A 4-by-4 halftoning matrix is used to render each pixel, resulting
in 1280 dots vertically and 800 dots horizontally (again, not including
the left margin).
A 4-by-4 halftoning matrix provides 17 intensities. In color, only a select
8 intensities are used. All 17 intensities are used when printing 7 by 9
format pictures in black, resulting in a surprisingly faithful halftoned image.
FREEWARE
This program is Freeware. I have released it to the Atari ST community
in the hope that it will prove useful to other Okimate owners. If you have
questions or comments I can be reached by electronic mail as:
74016,352 on Compuserve;
cemax!greg@sj.ate.slb.com on the Internet.
You are hereby granted permission to give a copy of this program to anyone
whom you feel may benefit from its use, provided that you don't alter the
program or the resource file, and provided this documentation accompanies
any and all copies you distribute. All other rights remain with the author.
CREDIT WHERE CREDIT IS DUE
This program was written in the C Programming Language. It was compiled
with Mark Williams C, version 3.0.6. The Resource file was constructed
using the excellent Mark Williams ReSource editor.
Documentation on the Spectrum file format was obtained via Compuserve,
courtesy of Boris Tsikanovsky.
Information on halftoning and RGB to CMY conversion was obtained from
"Fundamentals of Interactive Computer Graphics", by Foley and Van Dam,
first edition.
Information on programming the Okimate 20 for color printing was discovered
by the author through experiment, and by reading between the lines of the
woefully inadequate and error-ridden Okimate 20 printer manual.